<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>

<table class="styled" cellspacing="0">
    <tr>
        <th class="styled"><html:link action="sortResults.do?method=sortId">ID#</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortPriority">Priority %</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortPercent">% Complete</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortName">Name</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortType">Task Type</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortStatus">Status</html:link></th>
        <th class="styled"><html:link action="sortResults.do?method=sortResponsible">Responsible</html:link></th>
    </tr>
    <logic:iterate name="resultValues" id="task">
        <% int val = 15 - ((NodeSearchResult)task).getPriority().intValue() * 15 / 100; %>
        <tr>
            <td class="styled">
                <html:link action="showNode.do" paramId="nodeId" paramName="task" paramProperty="id">
                    <beans:write name="task" property="id"/>
                </html:link>
            </td>
            <td class="styled">
                <div class="histogram" style="width: <beans:write name="task" property="priority"/>%; background-color:#f<%=Integer.toHexString(val) %><%=Integer.toHexString(val) %>">&nbsp;</div>
            </td>
            <td class="styled">
                <div class="histogram" style="width: <beans:write name="task" property="percent"/>%;">&nbsp;</div>
            </td>
            <td class="styled">
                <beans:write name="task" property="name"/>
            </td>
            <td class="styled">
                <beans:write name="task" property="taskType"/>
                <logic:empty name="task" property="taskType">
                    &nbsp;
                </logic:empty>
            </td>
            <td class="styled">
                <beans:write name="task" property="status"/>
                <logic:empty name="task" property="status">
                    &nbsp;
                </logic:empty>
            </td>
            <td class="styled">
                <beans:write name="task" property="responsible"/>
                <logic:empty name="task" property="responsible">
                    &nbsp;
                </logic:empty>
            </td>
        </tr>
    </logic:iterate>
</table>
